import Vue from 'vue';
import VueRouter from 'vue-router';


// 注册路由组件,可以用到<router-view></router-view>和<router-list></router-list>>
Vue.use(VueRouter)


// 3创建路由实例 映射路径和组件
import Home from '../viows/Home'
import Gouwuche from '../viows/Gouwuche'
import Huiyuan from '../viows/Huiyuan'
import Sousuo from '../viows/Sousuo'
import NewList from '../viows/zizujin/NewsList'
import NewsDetial from '../viows/zizujin/NewsDetial'
import Shangpin from '@/viows/zizujin/Shangpin'
import INfo from '@/viows/zizujin/INfo'
import Xinwen from '@/viows/Xinwen'
import Tuwenjies from '@/viows/Tuwenjies'
const routes = [
    {path:"/",component:Home},
    {path:"/home",component: Home},
    {path:"/gouwuche",component: Gouwuche},
    {path:"/huiyuan",component: Huiyuan},
    {path:"/sousuo",component: Sousuo},
    {path:"/newList",component: NewList},
    {path:"/newsDetial/:id",component: NewsDetial},
    {path:"/shangpin",component: Shangpin},
    {path:"/info/:id",component: INfo},
    {path:"/xinwen/:id",component: Xinwen},
    {path:"/tuwenjies",component: Tuwenjies},
]
// 创建路由实例
const router=new VueRouter({
    routes: routes,
    mode:'history'
})
// 导出路由实例
export default router